/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.myproject.ordendigital.controller;

import com.myproject.ordendigital.model.Estado;
import com.myproject.ordendigital.service.EstadoService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 *
 * @author JcM
 */
@Controller
public class EstadoController {
    
    @Autowired
    EstadoService service;


    Estado estado = new Estado();

    @RequestMapping(value="/estadoList.htm", method=RequestMethod.GET)
    public ModelAndView newList(){
        ModelAndView mav = new ModelAndView("estadoList");
        estado.setIdEstado(1);
        List<Estado> estados = service.obtenerListaEstado(estado);
        mav.addObject("data", estados);
        return mav;
    }
}
